//
//  CZQMainTabBar.m
//  LoveBeer
//
//  Created by 崔正强 on 17/4/27.
//  Copyright © 2017年 崔正强. All rights reserved.
//

#import "CZQMainTabBar.h"

@implementation CZQMainTabBar

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    for (UIView *subView in self.subviews) {
        
        if ([subView isKindOfClass:NSClassFromString(@"UITabbarButton")]) {
            
            UIControl *control = ( UIControl *)subView;
            
            [control addTarget:self action:@selector(scaleItem:) forControlEvents:UIControlEventTouchUpInside];
            
        }
        
    }
    
}

- (void)scaleItem:(UIControl *)sender {
    
    [UIView animateWithDuration:0.2 animations:^{
        
        sender.transform = CGAffineTransformMakeScale(1.5, 1.5);
    } completion:^(BOOL finished) {
        
        [UIView animateWithDuration:0.2 animations:^{
            
            sender.transform = CGAffineTransformIdentity;
        }];
    }];
}


@end
